package cn.xlbweb.sso.controller;

import cn.xlbweb.sso.server.LayuiTable;
import cn.xlbweb.sso.service.IOnlineUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;

/**
 * @author: bobi
 * @date: 2019-03-09 17:32
 * @description:
 */
@RestController
@RequestMapping("onlineUser")
public class OnlineUserController {

    @Autowired
    private IOnlineUserService iOnlineUserService;

    @GetMapping("list")
    public ModelAndView index() {
        ModelAndView modelAndView = new ModelAndView();
        modelAndView.setViewName("/onlineUser/onlineUser-list");
        return modelAndView;
    }

    @PostMapping("list")
    public LayuiTable list(@RequestParam(value = "page", defaultValue = "1") Integer page,
                           @RequestParam(value = "limit", defaultValue = "10") Integer limit) {
        return iOnlineUserService.list(page, limit);
    }
}
